package com.mybatis.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mybatis.pojo.User;
import com.mybatis.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @ProjectName: mybatis_plus
 * @Package: com.mybatis.controller
 * @ClassName: HomeController
 * @author: Arisapoke
 * @date: 2021/2/20 16:39
 * @Version: 1.0
 */
@RestController
@RequestMapping("home")
public class HomeController  {

    @Resource
    private UserService userService;

    @GetMapping("/userIPage")
    public IPage<User> userInfoTable() {
        /**
         * Page(current,size)
         * current:当前页,long类型
         * size:每页显示的数量,long类型
         * 可参考其构造方法
         */
        IPage<User> userIPage = userService.userInfoTable();
        return userIPage;
    }
}
